package com.eshop.enums;

import java.util.stream.Stream;

public enum PayTypeEnum
{
    ALI("alipay", "支付宝支付"), 
    WEIXIN("weixin", "微信支付"), 
    YUE("yue", "余额支付"), 
    INTEGRAL("integral", "积分兑换");
    
    private String value;
    private String desc;
    
    public static PayTypeEnum toType(final String value) {
        return Stream.of(values()).filter(p -> p.value.equals(value)).findAny().orElse(null);
    }
    
    public String getValue() {
        return this.value;
    }
    
    public String getDesc() {
        return this.desc;
    }
    
    private PayTypeEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
}
